#include<stdio.h>
#include<string.h>
struct Candidate
{
	char name[10];
	unsigned int count;
};
int main()
{
	struct Candidate zs,ls,ww;
	strcpy(zs.name,"ZS");
	strcpy(ls.name,"LS");
	strcpy(ww.name,"WW");
	zs.count=0;
	ls.count=0;
	ww.count=0;
	int n,qq=0;
	scanf("%d",&n);
	if(n<4||n>100)
	{
		printf("Input Error");
		return 0;
	}
	char tem[100];
	for(int i=0;i<n;i++)
	{
		scanf("%s",tem);
		if(!strcmp(tem,zs.name))
		{
			zs.count++;
		}
		else if(!strcmp(tem,ls.name))
		{
			ls.count++;
		}
		else if(!strcmp(tem,ww.name))
		{
			ww.count++;
		}
		else
		{
			qq++;
		}
	}
	printf("ZS:%d\nLS:%d\nWW:%d\nQQ:%d\n",zs.count,ls.count,ww.count,qq);
	return 0;
}
